<%= render :partial => "/tr8n/admin/common/header" %>
<%= render :partial => "tabs" %>
<%= tr8n_will_filter(@topics) %>

<%= form_tag("", :id => "tr8n_form") do %>
  <%= hidden_field_tag(:type, "topic") %>
  <%= will_filter_table_tag(@topics, :columns => [
    [:icn, image_tag("tr8n/icons/comments.png"), :title => "", :style => "width:12px;"],
    [:checkbox, :ids],
    :created_at,
    [:language_id, lambda{|topic|
      if topic.language
        link_to(topic.language.english_name, :controller => "/tr8n/admin/language", :action => :view, :lang_id => topic.language.id)
      else
         "Deleted Language"    
      end  
    }, :filterable => true], 

    [:translator_id, lambda{|topic|
      if topic.translator
        link_to(topic.translator.name, :controller => "/tr8n/admin/translator", :action => :view, :translator_id => topic.translator.id) 
      else
         "Deleted Translator"    
      end  
    }, :filterable => true], 
    
    :topic,

    [:actions, lambda{|topic|
      tr8n_actions_tag([
        link_to("View Messages", "/tr8n/admin/forum/messages?wf_c0=language_forum_topic_id&wf_o0=is&wf_v0_0=#{topic.id}"),
        link_to_function("Delete", "deleteObjects('#{topic.id}')")
      ])
    }, 'padding:5px;text-align:right;white-space:nowrap;'] 
  ]) %>
<% end %>

<%= will_filter_actions_bar_tag(@topics, [
  ['Delete Selected Topics', 'deleteObjects()'] 
]) %>


<%= render :partial => "/tr8n/admin/common/footer" %>
